import {reqSearchListInfo} from '@/api'

const state = {
    searchListInfo: {}
}
const mutations = {
    RECEIVE_SEARCHLISTINFO(state, searchListInfo) {
        state.searchListInfo = searchListInfo
    }
}
const actions = {
    async getSearchInfo({commit}, searchParams) {
        const result = await reqSearchListInfo(searchParams)
        if (result.code === 200) {
            commit('RECEIVE_SEARCHLISTINFO', result.data)
        }
    }
}
const getters = {
    attrsList(state) {
        return state.searchListInfo.attrsList
    },
    goodsList(state) {
        return state.searchListInfo.goodsList
    },
    trademarkList(state) {
        return state.searchListInfo.trademarkList
    }
}
export default {
    state,
    mutations,
    actions,
    getters
}